import request from './request'

// 管理员登录
export const login = (data) => {
  return request({
    url: '/auth/login',
    method: 'post',
    data
  })
}

// 获取当前用户信息
export const getProfile = () => {
  return request({
    url: '/auth/profile',
    method: 'get'
  })
}

// 退出登录
export const logout = () => {
  sessionStorage.clear()
  window.location.href = '/login'
}
